class Validator {
    static validator(value, rule) {
        let reg;
        if (typeof rule === 'string') {
            reg = new RegExp(rule);
        }
        else {
            reg = rule;
        }
        return reg.test(value);
    }
}
Validator.phoneReg = /^1[3|4|5|8|7][0-9]\d{8}$/;
Validator.urlReg = new RegExp('(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]', 'g');
Validator.numberReg = /^\d+(\.\d+)?$/;
export default Validator;
